{% extends "login_base.html" %}

{% block content %}
    {% if form.errors %}
        <div class="text-danger">
            <p>Your username and password didn't match. Please try again.</p>
        </div>
    {% endif %}

    {% if next %}
        {% if user.is_authenticated %}
            <p>Your account doesn't have access to this page. To proceed,
                please login with an account that has access.</p>
        {% else %}
            <p>Please login to see this page.</p>
        {% endif %}
    {% endif %}

    <form method="post" action="{% url 'login' %}">
        {% csrf_token %}
        <div class="form-floating">
            <label for="floatingInput">用户名</label>
            <input name="username" type="text" class="form-control" id="floatingInput" placeholder="name@example.com"
                   required>
        </div>
        <div class="form-floating">
            <label for="floatingPassword">密码</label>
            <input name="password" type="password" class="form-control" id="floatingPassword" placeholder="Password"
                   required>
        </div>

        <button class="w-100 btn btn-lg btn-info" type="submit">登录</button>


        <input type="hidden" name="next" value="{{ next }}">
    </form>

    {# Assumes you setup the password_reset view in your URLconf #}
    <p><a href="{% url 'password_reset' %}">Lost password?</a></p>
{% endblock %}